<?php
include("../config/connect.php");
require_once("../public/common.php");

// 更新cache数据
date_default_timezone_set("Asia/Chongqing");
require_once("../taobaoapi/funs.php");

//
$sql = "select id from cache_items order by id desc limit 1";
$result = mysql_query( $sql );
if (mysql_num_rows($result) > 0)
{
	$row = mysql_fetch_assoc( $result );
	$idbase = $row["id"];
}
else
	$idbase = 1;
	
$sql = "select id,pay_time,real_pay_fee,num_iid,item_title,commission from report_items where id > $idbase order by id limit 10";
$result = mysql_query( $sql );
while( $result && $row = mysql_fetch_assoc( $result ))
{
	$json = json_decode(GetItemInfo($row["num_iid"]));
	if ($json->code == 1)
	{
	 	$pic_url = $json->pic_url;
		$url = $json->detail_url;
		if ($pic_url != "")
		{
			$sql = "insert into cache_items (id, time, fee, num_iid, item_title, commission, pic_url, url) values 
			(".$row["id"].",'".$row["pay_time"]."',".$row["real_pay_fee"].",'".$row["num_iid"]."','".$row["item_title"]."',".$row["commission"].",'$pic_url','$url')";
			mysql_query( $sql );
//			if (mysql_affected_rows() > 0)
//				$nHasInsert++;
		}
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>购物兔捆绑页面</title>
<link type="text/css" rel="stylesheet" href="css/beginner.css" />
</head>
<body>
<div class="item head">
	<h1 id="logo_img"><a href="http://www.gouwutu.com"><img src="http://www.gouwutu.com/new/images/sslogo.gif" alt="购物兔，返现就这么简单" title="购物兔，返现就这么简单"></a></h1>
	<div id="m">
    <div id="fm">
    	<form target="_blank" onsubmit="return Adjust('kw')" method="get" action="http://www.gouwutu.com/new/s/">
        	<p class="gwt_ss"><input type="text" value="输入您想要的宝贝名称或网址~" onfocus="if(this.value=='输入您想要的宝贝名称或网址~'){this.value='';this.style.color = '#333';} this.select();" onblur="if(this.value==''){this.value='输入您想要的宝贝名称或网址~';this.style.color = '#BABABA';}" autocomplete="on" name="q" id="kw" maxlength="1024"></p>
            <p class="btn_wr"><input type="submit" value="" id="su" class="btn" onmousedown="" onmouseout=""></p>
            <input type="hidden" value="" id="id" name="id">
            <input type="hidden" value="" id="url" name="url">
     	</form>
  	</div>
    <p class="tsearch-hot">
        <!-- 热门标签 -->
        <span>热门搜索：</span>
        <a class="h" href="http://www.gouwutu.com/new/s/?q=<?php echo urlencode('蚕美人'); ?>" target="_blank">蚕美人</a>
        <a href="http://www.gouwutu.com/new/s/?q=<?php echo urlencode('雪地靴'); ?>">雪地靴</a>
        <a href="http://www.gouwutu.com/new/s/?q=<?php echo urlencode('打底裤'); ?>">打底裤</a>
        <a class="h" href="http://www.gouwutu.com/new/s/?q=<?php echo urlencode('棉衣'); ?>">棉衣</a>
        <a href="http://www.gouwutu.com/new/s/?q=<?php echo urlencode('毛线围巾'); ?>">毛线围巾</a>
        <a href="http://www.gouwutu.com/new/s/?q=<?php echo urlencode('羽绒服'); ?>">羽绒服</a>
        <a href="http://www.gouwutu.com/new/s/?q=<?php echo urlencode('长款毛衣'); ?>">长款毛衣</a>
        <a href="http://www.gouwutu.com/new/s/?q=<?php echo urlencode('外套'); ?>">外套</a>
        <a href="http://item.taobao.com/item.htm?id=13781896004&ref=&ali_trackid=2:mm_30110718_0_0:1328615735_4z5_1613400909 ">公文包</a>
        <a href="http://www.gouwutu.com/top/index.php" class="more">更多</a>
        <b class="gr-l"></b>
        <b class="gr-r"></b>
        <!--end-->
    </p>
</div>
	<div id="show_date_div" class="date"></div>
</div>
<div id="nav_bar">
	<div class="item menu">
    	<p><span>立即绑定获赠100兔币！</span><a href="http://www.gouwutu.com/myservices/bangding.html" target="_blank" title="绑定注册">绑定注册</a></p>
    	<ul>
        	<li>简介</li>
            <li><a href="../new/mall/" target="_blank">百家商城</a></li>
            <li><a href="http://v.youku.com/v_show/id_XMzUyNjU2MDMy.html" target="_blank" title="点击进入视频教程">视频教程</a></li>
        </ul>
    </div>
</div>
<div id="body_wrap">
	<div class="item">
    	<div class="jj left">购物兔是国内首个以帮用户网购省钱为宗旨的优秀软件，是冰峰科技旗下的一款网购省钱平台，能帮用户深度挖掘淘宝、京东、凡客、卓越、当当等百家商城的商品里的隐藏折扣，让用户在享受商品折扣的同时，还能得到返现，真真正正实现折上折！<a href="http://www.gouwutu.com/myservices/bangding.html" target="_blank">立即注册</a></div>
    	<div class="hdp left">
       		<!---顶部轮播开始--->
            <div id="slide">
                <div class="slide_lun"><ul class="lun"><li class="ac">1</li><li>2</li><li>3</li><li>4</li><li>5</li></ul></div>
                <div id="slide_list">
                    <a href="http://www.gouwutu.com/myservices/bangding.html?ref=www.gouwutu.com%2Fnew%2Fs%2Fgotoitem.php%3Fiid%3D13033847674%26click_url%3Dhttp%253A%252F%252Fs.click.taobao.com%252Ft_8%253Fe%253D7HZ6jHSTbIOW1Kjm9%25252FKlsR%25252BMIYMbBE69P6%25252BaqaNu23ZnPbdBWlZM%25252FAQ5EVXocCmfzoi2vWGkRfnZw7cu4Ccya5RSvMjRFGxLYfHtkxg31KiGy7OWuQ%25253D%25253D%2526p%253Dmm_29013260_0_0%2526n%253D19%2526u%253D0" target="_blank"><img src="../new/images/gg/kunbang1.gif" alt="" /></a>
                    <a href="http://www.gouwutu.com/new/s/?q=%E9%9F%A9%E7%89%88%E5%A5%B3%E8%A3%85%E5%A4%96%E5%A5%97%E5%A5%B3%E7%A7%8B%E5%86%AC%E4%B8%AD%E9%95%BF%E6%AC%BE%E7%BE%8A%E6%AF%9B%E5%91%A2%E5%AD%90%E5%A4%A7%E8%A1%A3%E6%AF%9B%E5%91%A2%E5%A4%96%E5%A5%97N110109&Submit=&id=&url=&start_price=&end_price=&area=&sort=commissionNum_desc&nick=&list=0" target="_blank"><img src="../new/images/gg/kunbang2.gif" alt="" /></a>
                    <a href="http://www.appinn.com/gouwutu/" target="_blank"><img src="../new/images/gg/kunbang3.gif" alt="" /></a>
                    <a href="http://tech.qq.com/a/20110307/000325.htm" target="_blank"><img src="../new/images/gg/kunbang4.gif" alt="" /></a>
                    <a href="http://www.zhuhaidaily.com.cn/text.php?ud_key=39677&ud_date=2011-09-23" target="_blank"><img src="../new/images/gg/kunbang5.gif" alt="" /></a>
                </div>
            </div>
            <!--顶部轮播结束-->
        </div>
    </div>
</div>
<div id="body_jiac">
	<div class="item guide">
    	<a href="http://v.youku.com/v_show/id_XMzUyNjU2MDMy.html" target="_blank" title="点击进入视频教程"></a>
    </div>
    <div class="GWT_newBuy">
        <div id="Iframes">
            <div class="being_bought">
        <div id="bought_page" class="bought_cen">
            <div class="bought_LeftBotton" id="LeftArr">
                <span title="Back" class="bought_cen_left">
                    <a href="javascript:;">向左</a>
                </span>
            </div>
            <div class="bought_cen_list" id="ISL_Cont_1">
                <div>
                <ul id="List1_1">
                <?php
                //$sql = "select * from fanwe_share_goods order by rand(now()) limit 25";
                $sql = "select num_iid, pic_url, url, item_title, time, fee, commission from cache_items where pic_url<>'' group by num_iid order by time desc limit 25";
                $result = mysql_query( $sql );
                while( $result && $row = mysql_fetch_assoc( $result ))
                {
                ?>
                    <li>
                        <a href="http://www.gouwutu.com/new/q/?id=<?php echo $row["num_iid"]; ?>&q=<?PHP echo urlencode($row["item_title"]); ?>" class="product_img" title="省：<?PHP echo round($row["commission"] * 0.6, 2); ?>元"><img alt="<?PHP echo $row["item_title"]; ?>" src="<?PHP echo $row["pic_url"]."_170x170.jpg"; ?>"> </a>               
                        <h3><a href="http://www.gouwutu.com/new/q/?id=<?php echo $row["num_iid"]; ?>&q=<?PHP echo urlencode($row["item_title"]); ?>" title="<?PHP echo $row["item_title"]; ?>" ><?PHP echo $row["item_title"]; ?></a></h3> 
                        <p>优惠价：<b class="price">￥<?PHP echo $row["fee"]; ?></b></p>
                        <p>还可返：<span class="price">￥<?PHP echo round($row["commission"] * 0.6, 2); ?></span></p>
                    </li>
                <?php } ?>     
                </ul>
                </div>
            </div>
            <div class="bought_RightBotton" id="RightArr">
                <span class="bought_cen_right">
                    <a title="Next" href="javascript:;">向右</a>
                </span>
            </div>
        </div>
    </div>
<script type="text/javascript" src="../n2/v2/css/nav/jquery.js"></script>
<script type="text/javascript" src="http://www.gouwutu.com/new/js/ScrollPic.js"></script>
    <SCRIPT language=javascript type=text/javascript>
    <!--//--><![CDATA[//><!--
    var scrollPic_02 = new ScrollPic();
    scrollPic_02.scrollContId   = "ISL_Cont_1"; //内容容器ID
    scrollPic_02.arrLeftId      = "LeftArr";//左箭头ID
    scrollPic_02.arrRightId     = "RightArr"; //右箭头ID
    
    scrollPic_02.frameWidth     = 875;//显示框宽度
    scrollPic_02.pageWidth      = 444; //翻页宽度
    
    scrollPic_02.speed          = 10; //移动速度(单位毫秒，越小越快)
    scrollPic_02.space          = 20; //每次移动像素(单位px，越大越快)
    scrollPic_02.autoPlay       = true; //自动播放
    scrollPic_02.autoPlayTime   = 5; //自动播放间隔时间(秒)
    scrollPic_02.initialize(); //初始化
                        
    //--><!]]>
    </SCRIPT>	
        </div>
    </div>
</div>
<div style="overflow: hidden; width: 950px; margin:0 auto; padding:20px 0; text-align: center; color:#F3AA8B;">
	<p id="lh"><a target="_blank" href="http://www.gouwutu.com/new/doc/coop">下载购物兔</a> | <a target="_blank" href="http://www.gouwutu.com/union">加入购物兔联盟</a> | <a target="_blank" href="http://www.gouwutu.com/faq/help_faq1_01.html">新手指导</a> | <a target="_blank" href="http://www.tusijie.com">兔丝街</a> | <a target="_blank" href="http://www.gouwutu.com/top/index.php">风云榜</a> | <a target="_blank" href="http://www.gouwutu.com/aboutus.html">关于购物兔</a></p>
  	<p id="cp"> Copyright &copy;2008-2011  购物兔返利网  版权所有   <a href="http://www.miibeian.gov.cn" target="_blank">粤ICP备11009208号</a> </p>
</div>
</body>
</html>
<!---幻灯片--->
<script type="text/javascript" language="javascript">
var t = n = count = 0;
$(function(){
    count = $("#slide_list a").size();
    $("#slide_list a:not(:first-child)").hide();
    //$("#slide ul li:first-child").css({"background":"#CE0609",'color':'#fff'});
	$("#slide ul li:first-child").addClass("ac");
    $("#slide ul li").click(function() {
        var i = $(this).text() - 1;
        n = i;
        if (i >= count) return;
        //$("#slide_info").html($("#slide_list a").eq(i).find("img").attr('alt'));
        //$("#slide_info").unbind().click(function(){window.open($("#slide_list a").eq(i).attr('href'), "_blank")})
        $("#slide_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
        //$(this).css({"background":"#CE0609",'color':'#fff'}).siblings().css({"background":"none",'color':'#fff'});
		$(this).addClass("ac").siblings().removeClass("ac");
    });
    t = setInterval("showAuto()", 4000);
    $("#slide").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 4000);});
})
function showAuto(){
    n = n >= (count - 1) ? 0 : n + 1;
    $("#slide ul li").eq(n).trigger('click');
}
</script>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-20984072-1");
pageTracker._trackPageview();
} catch(err) {}</script>

<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F7eb75a7b189f4a709dead85bc20eb0dd' type='text/javascript'%3E%3C/script%3E"));
</script>
